# curl glfw项目配置
cmake_minimum_required(VERSION 3.16.3)
project ("hello")# LANGUAGES CXX
enable_language(C)
enable_language(CXX)
# vcpkg配置，必须位于project之前
if(DEFINED ENV{VCPKG_ROOT})
  set(VCPKG_ROOT "$ENV{VCPKG_ROOT}" CACHE PATH "") # 从环境变量中读取vcpkg根目录
else()
  set(VCPKG_ROOT "D:/Program/vcpkg" CACHE PATH "") # 手动设置vcpkg根目录
endif()
# message("set VCPKG_ROOT: ${VCPKG_ROOT}")
set(VCPKG_FEATURE_FLAGS "manifests;version") # 用于支持自定义依赖版本
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") # 设置vcpkg工具链
set(CMAKE_CXX_STANDARD 17)
# add_definitions(-DBL_STATIC)
# aux_source_directory(${PROJECT_SOURCE_DIR}/src SCPP)
# set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "VCPKG Triplet")
set(CMAKE_PREFIX_PATH ${PROJECT_SOURCE_DIR}/vcpkg_installed/x64-windows-static)
# list(APPEND CMAKE_PREFIX_PATH ${VCPKG_ROOT}/install/x64-windows-static)
add_compile_options("/source-charset:utf-8")
# 设置静态库编译选项
if(MSVC)
  set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
# 查找 blend2d 包
find_package(blend2d CONFIG REQUIRED)
# find_package(cxxopts CONFIG REQUIRED)
# include_directories(${PROJECT_SOURCE_DIR})
include_directories(${CMAKE_PREFIX_PATH}/include)
# message("skia include dir: ${CMAKE_PREFIX_PATH}/include")
# 添加可执行文件
add_executable(${PROJECT_NAME} blend.cpp)

# 链接 blend2d 到你的可执行文件
target_link_libraries(${PROJECT_NAME} PRIVATE blend2d::blend2d)